# import pickle
# try:
#     for i in range(3):
#         for j in range(3):
#             if i==2:
#                 raise KeyboardInterrupt
#             print(i,j)
# except KeyboardInterrupt:
#     print('退出啦')
import random
secret=random.randint(1,10)
print('--------------猜数字游戏---------------')
temp=input('请输入一个数字开始游戏：')
try:
    guess=int(temp)
except ValueError as reason:
    print('请输入一个整数！')
while guess !=secret:
    temp=input('猜错了重新输入吧')
    try:
        guess=int(temp)
    except ValueError:
        print('请输入一个整数！')
    if guess== secret:
        print('猜对了')
    else:
        if guess > secret:
            print('大了')
        else:
            print('小了')
print('游戏结束！')